import request from '@/http/index'
const baseUrl = '/portal/r/jd'

//门户切换
export function getTaskNumApi(sid) {
	return request({
		method: 'get',
		url: `${baseUrl}?sid=${sid}&cmd=portal.person.gettasknum`
	});
}
export function getApplicatApi(sid) {
	return request({
		method: 'post',
		url: `${baseUrl}?sid=${sid}&cmd=portal.person.getsystem`
	});
}
export function getHelpWordApi(sid) {
	return request({
		method: 'post',
		url: `${baseUrl}?sid=${sid}&cmd=portal.person.helpword`
	});
}
export function getFunctionApi(sid) {
	return request({
		method: 'post',
		url: `${baseUrl}?sid=${sid}&cmd=portal.person.getfunctionlist`
	});
}
export function getWaitTaskApi(sid, params) {
	return request({
		method: 'post',
		url: `${baseUrl}?sid=${sid}&cmd=portal.person.todoList&query=${params}`
	});
}
export function getHandleTaskApi(sid, params) {
	return request({
		method: 'post',
		url: `${baseUrl}?sid=${sid}&cmd=portal.person.tractList&query=${params}`
	});
}
export function getCreateTaskApi(sid, params) {
	return request({
		method: 'post',
		url: `${baseUrl}?sid=${sid}&cmd=portal.person.mycreate&query=${params}`
	});
}
export function getCommonMenuApi(sid) {
	return request({
		method: 'post',
		url: `${baseUrl}?sid=${sid}&cmd=portal.person.getcylist`
	});
}
export function addCommonMenuApi(sid, type, functionId) {
	return request({
		method: 'post',
		url: `${baseUrl}?sid=${sid}&cmd=portal.person.operacylist&type=${type}&functionId=${functionId}`
	});
}
export function showFunctionApi(sid, type, functionId) {
	return request({
		method: 'post',
		url: `${baseUrl}?sid=${sid}&cmd=portal.person.operafunctionlist&type=${type}&functionId=${functionId}`
	});
}

export function sortCommonMenuApi(sid, functionId, newFunctionId) {
	return request({
		method: 'post',
		url: `${baseUrl}?sid=${sid}&cmd=portal.person.pxcylist&functionId=${functionId}&newFunctionId=${newFunctionId}`
	});
}
export function getTopUrlApi(sid) {
	return request({
		method: 'post',
		url: `${baseUrl}?sid=${sid}&cmd=portal.person.gettopurl`
	});
}
export function getNewMessageApi(sid) {
	return request({
		method: 'post',
		url: `${baseUrl}?sid=${sid}&cmd=com.actionsoft.apps.notification_load_unread_msg`
	});
}

export function getMessageAllApi(sid) {
	return request({
		method: 'post',
		url: `${baseUrl}?sid=${sid}&cmd=portal.person.getunreadnum`
	});
}

export function getReadMessageApi(sid, id, registerId) {
	return request({
		method: 'post',
		url: `${baseUrl}?sid=${sid}&cmd=com.actionsoft.apps.notification_read_all_message&id=${id}&registerId=${registerId}`
	});
}

export function getUrgeTaskApi(sid, userIds, processInstId) {
	return request({
		method: 'post',
		url: `${baseUrl}?sid=${sid}&cmd=portal.person.cb&userIds=${userIds}&processInstId=${processInstId}`
	});
}

export function getUserSession(sid) {
	return request({
		method: 'post',
		url: `${baseUrl}?sid=${sid}&cmd=portal.getusersession`
	});
}

